Repository navigation
RoiStuff: emit the cropped data in live mode too - #21
Merged
Merged
Conversation
- the live branch of grab_data built the cropped DataToExport but emitted the uncropped one - factor the cropping in a crop() method used by both live and single grabs; it returns the data unchanged if 'Use Roi' is off or no ROI select has been made yet (it crashed before) - set the 'sliced' extra attribute on the cropped data (was set on the original one) - remove the extra grab/emission done after the live loop and the useless center_origin - log the crosshair position instead of printing it Related to PyMoDAQ/PyMoDAQ#1237 Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the bug in
daq_2Dviewer_RoiStuff.pyreported in PyMoDAQ/PyMoDAQ#1237: in live mode,grab_databuilt the croppedDataToExportbut emitted the uncroppeddata.crop()method is used by both the live and single grabs. It crops withdwa.vsig[roi_select_info.to_slices(False)], because the ROI select is given in the units of the viewer axes, which are scaled in this plugin. It returns the data unchanged if Use Roi is off or no ROI select has been made yet (that case crashed before).slicedextra attribute is now set on the cropped data, not on the original.center_origin()call.Test
Headless check with the plugin instantiated directly:
sliced=True, and the live mode gives 3 cropped (10, 20) frames.This plugin is used as the reference example in the new ROI select documentation (PyMoDAQ/PyMoDAQ#1237).
🤖 Generated with Claude Code